<div class="breadcrumb">
        <a href="/admin/index">Home</a>
         :: <a href="/admin/user">User Manage</a>
</div>
	<?php  if(isset($this->success)) {?>
<div class="success" style="text-align: center;"><?php echo $this->success;?></div>
	<?php }?>
	<?php if(isset($this->warning)) {?>
<div class="warning" style="text-align: center;"><?php  echo $this->warning;?></div>
	<?php }?>
<div class="box">
    <div class="heading">
		<h1><img alt="" src="/images/admin/user-group.png"> User Manage</h1>
		<div class="buttons">
			<a class="button" onclick="$('#form').submit();"><?php echo $this->button;?></a>
			<a class="button" onclick="location = '<?php echo $this->cancel;?>';">Cancel</a>
		</div>
    </div>
    <div class="content">
		<form id="form" enctype="multipart/form-data" method="post" action="<?php echo $this->action;?>">
			<table class="form">
			<tbody>
				<tr>
					<td><span class="required">*</span> Username:</td>
					<td><input maxlength="45" type="text" value="<?php if(isset($this->data_user['username'])) echo $this->data_user['username'];?>" size="40" name="username">
					</td>
				</tr>
				<tr>
					<td><span class="required">*</span> Full Name:</td>
					<td><input maxlength="45" type="text" value="<?php if(isset($this->data_user['fullname'])) echo $this->data_user['fullname'];?>" size="40" name="fullname">
					</td>
				</tr>
				<tr>
					<td><span class="required">*</span> Gender:</td>
					<td>
						<select class="select" tabindex="0" name="sltSex" id="sltSex">
							 <?php if(isset($this->data_user['sltSex']) && $this->data_user['sltSex']!=-1) {?>
							  <option value="-1">Chọn</option>
							 <?php if($this->data_user['sltSex']==0) {?>
							  <option value="0" selected="selected">Nữ</option>
							  <option value="1">Nam</option>
							 <?php } else {?>
							  <option value="0">Nữ</option>
							  <option value="1" selected="selected">Nam</option>
							 <?php } } else {?>
							  <option value="-1" selected="selected">Chọn</option>
							  <option value="1">Nam</option>
							  <option value="0">Nữ</option>
							 <?php }?>
						</select>
					</td>
				</tr>
          
				<tr>
					<td><span class="required">*</span> Birthday:</td>
					<td>
						<select class="select" tabindex="0" name="dBirthday" id="dBirthday">
							<?php for($i=1;$i<32;$i++) {?>
							<?php if(isset($this->data_user['dBirthday']) && $this->data_user['dBirthday']==$i ) {?>
							<option value="<?php echo $i;?>" selected="selected"><?php echo $i;?></option>
							<?php } else {?>
							 <option value="<?php echo $i;?>"><?php echo $i;?></option>
							 <?php } }?>
						 </select>
						  <select class="select" tabindex="0" name="mBirthday" id="mBirthday">
							  <?php for($i=1;$i<13;$i++) {?>
							   <?php if(isset($this->data_user['mBirthday']) && $this->data_user['mBirthday']==$i ) {?>
							<option value="<?php echo $i;?>" selected="selected"><?php echo $i;?></option>
							<?php } else {?>
							 <option value="<?php echo $i;?>"><?php echo $i;?></option>
							   <?php } }?>                     		                                                                           
						   </select>
						   <select class="select" tabindex="0" name="yBirthday" id="yBirthday">
							 <?php for($i=date("Y")-1;$i>=1900;$i--) {?>
							  <?php if(isset($this->data_user['yBirthday']) && $this->data_user['yBirthday']==$i ) {?>
							<option value="<?php echo $i;?>" selected="selected"><?php echo $i;?></option>
							<?php } else {?>
							 <option value="<?php echo $i;?>"><?php echo $i;?></option>
							   <?php }}?> 
						   </select>
					</td>
				</tr>
          
				<tr>
					<td><span class="required">*</span> E-Mail:</td>
					<td><input type="text" size="40" value="<?php if(isset($this->data_user['email'])) echo $this->data_user['email'];?>" name="email"></td>
				</tr>
				<tr>
					<td>Work:</td>
					<td><input type="text" size="40" value="<?php if(isset($this->data_user['work'])) echo $this->data_user['work'];?>" name="work"></td>
				</tr>

				<tr>
					<td>Address:</td>
					<td><input type="text" size="40" value="<?php if(isset($this->data_user['work'])) echo $this->data_user['address'];?>" name="address"></td>
				</tr>
				<tr>
					<td>User Group:</td>
					<td>
						<select name="user_group_id">
						<?php if(isset($this->group_user)) {?>
						<?php foreach($this->group_user as $gruser) {?>
						<?php if(isset($this->data_user['user_group_id']) && $this->data_user['user_group_id']==$gruser['group_id']) { ?>
						<option value="<?php echo $gruser['group_id'];?>" selected="selected"><?php echo $gruser['group_name'];?></option>
						<?php } else {?>
						<option value="<?php echo $gruser['group_id'];?>"><?php echo $gruser['group_name'];?></option>
						<?php }}}?>
						</select>
					 </td>
				</tr>
				<tr>
					<td>Password:</td>
					<td><input maxlength="100" type="password" size="40" value="" name="password"></td>
				</tr>
				<tr>
					<td>Confirm:</td>
					<td><input maxlength="100" type="password" size="40" value="" name="confirm"></td>
				</tr>
				<tr>
					<td>Status:</td>
					<td>
						<select name="status">
						<?php if(isset($this->data_user['status']) && $this->data_user['status']==1) { ?>
						<option value="0">Disabled</option>
						<option selected="selected" value="1">Enabled</option>
						<?php } else {?>
						<option selected="selected" value="0">Disabled</option>
						<option  value="1">Enabled</option>
						<?php }?>
						</select>
					</td>
				</tr>
			</tbody>
			</table>
		</form>
    </div>
</div>
